﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="productlist_parameter.aspx.cs"
    Inherits="YXShop.Web.admin.templates.label.productlist_parameter" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />

    <script src="../../../scripts/prototype.js" type="text/javascript"></script>

    <script src="../../scripts/public.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">

function ReturnValue()
{
    var ShowMode;
    var o=document.getElementsByName("rbl_ShowMode");//显示模式
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if( o[i].checked==true )
        {
            ShowMode=o[i].value;
        }
    }
    var ProductId="0";
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if(o[i].checked==true )
        {
            ShowMode=o[i].value;
            if(ShowMode=="6")
            {
                 ProductId=document.getElementById("hfcid").value;
            }
            else
            {
                ProductId="0";
            }
        }
    }
    
    var ShowState=document.getElementById("ddl_State").value //显示状态  
    var ShowIdentifier=document.getElementById("ddl_flag").value;//显示方式          
    var CompositorType;     
    o=document.getElementsByName("rbl_CompositorType");//排序方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if( o[i].checked==true )
        {
            CompositorType=o[i].value;
        }
    }
    var CompositorField =document.getElementById("ddl_filed").value; //排序字段
    var ShowRows = document.getElementById("Tb_rows").value;//显示行数
    var ShowColumns = document.getElementById("Tb_Columns").value;//显示列数
    var NameCharacter =document.getElementById("tb_namelength").value;//名称最大字符数

    var WhetherPagination;
    o=document.getElementsByName("rbl_page");//是否分页
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if( o[i].checked==true )
        {
            WhetherPagination=o[i].value;
        }
    }


    var Showfirst;
    o=document.getElementsByName("rbl_first");//布局方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            Showfirst=o[i].value;
        }
    }
    var TempletLayout;      
    o=document.getElementsByName("Rbl_TempletLayout");//布局方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            TempletLayout=o[i].value;
        }
    }
    var WhetherOmit;
    o=document.getElementsByName("rbl_WhetherOmit");//布局方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            WhetherOmit=o[i].value;
        }
    }
    var SpecialModule;
    o=document.getElementsByName("rdolstSpecial");//特殊模板
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            SpecialModule=o[i].value;
        }
    }
    var IsStoreLabel =document.getElementById("hfLabelClass").value;//是否是店铺标签
    
    var ContentCharacter = document.getElementById("tb_ContentCharacter").value;//内容最大字符数
    //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
    
    var cnm ="[YX:Loop,YX:LableType=ProductList,YX:ShowMode="+ShowMode+",YX:ShowState="+ShowState+",YX:ShowIdentifier="
    +ShowIdentifier+",YX:CompositorType="+CompositorType+",YX:CompositorField="
    +CompositorField+ ",YX:ShowRows="+ ShowRows+",YX:ShowColumns="+ShowColumns+
    ",YX:NameCharacter="+NameCharacter+",YX:WhetherPagination="+WhetherPagination+
    ",YX:Showhome="+Showfirst+",YX:TempletLayout="+TempletLayout+
    ",YX:ContentCharacter="+ContentCharacter+",YX:WhetherOmit="+WhetherOmit+",YX:IsStoreLabel="+IsStoreLabel+",YX:SpecialModule="+SpecialModule+",YX:ProductClassId="+ProductId+"]"+mystyle+"[/YX:Loop]";
    if(ShowMode=="7")
    {
        cnm ="[YX:Loop,YX:LableType=ProductFitting,YX:ShowState="+ShowState+",YX:ShowIdentifier="
        +ShowIdentifier+",YX:CompositorType="+CompositorType+",YX:CompositorField="
        +CompositorField+ ",YX:ShowRows="+ ShowRows+",YX:ShowColumns="+ShowColumns+
        ",YX:NameCharacter="+NameCharacter+",YX:WhetherPagination="+WhetherPagination+
        ",YX:Showhome="+Showfirst+",YX:TempletLayout="+TempletLayout+
        ",YX:ContentCharacter="+ContentCharacter+",YX:WhetherOmit="+WhetherOmit+",YX:IsStoreLabel="+IsStoreLabel+",YX:SpecialModule="+SpecialModule+",YX:ProductClassId="+ProductId+"]"+mystyle+"[/YX:Loop]";
    }
    parent.getValue(cnm);
    CloseDiv();

}

    function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 

function OptionProduct()
{
    var ShowMode;
    var o=document.getElementsByName("rbl_ShowMode");//显示模式
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
        if(o[i].checked==true )
        {
            ShowMode=o[i].value;
            if(ShowMode=="6")
            {
                 document.getElementById("OptionProduct").style.display="";
            }
            else
            {
                if(ShowMode=="7")
                {
                    document.getElementById("Specification").style.display="";
                }
                else
                {
                     document.getElementById("OptionProduct").style.display="none";
                }
            }
        }
    }
}

function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 99%; margin-top: 5px" class="form_table_input">
            <tr>
                <td>
                    显示方式<asp:HiddenField ID="hfLabelClass" runat="server" />
                </td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rbl_ShowMode" runat="server" RepeatDirection="Horizontal"
                        RepeatColumns="5" onclick="javascript:OptionProduct()">
                        <asp:ListItem Value="0" Selected="True">无参数</asp:ListItem>
                        <asp:ListItem Value="1">传商品分类ID查询</asp:ListItem>
                        <asp:ListItem Value="2">传商品品牌ID查询</asp:ListItem>
                        <asp:ListItem Value="3">传显示状态ID查询</asp:ListItem>
                        <asp:ListItem Value="4">商品搜索</asp:ListItem>
                        <asp:ListItem Value="5">商品对比</asp:ListItem>
                        <asp:ListItem Value="6">指定分类显示商品</asp:ListItem>
                        <asp:ListItem Value="7">商品配件</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr id="OptionProduct" style="display: none">
                <td>
                    选择分类
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtProductClass" runat="server"></asp:TextBox>
                    <asp:HiddenField runat="server" ID="hfcid" />
                </td>
            </tr>
            <tr>
                <td width="100">
                    显示状态
                </td>
                <td width="200">
                    <asp:DropDownList ID="ddl_State" runat="server" Height="25px" Width="133px">
                        <asp:ListItem Value="0">全部显示</asp:ListItem>
                        <asp:ListItem Value="1">推荐商品</asp:ListItem>
                        <asp:ListItem Value="3">热卖商品</asp:ListItem>
                        <asp:ListItem Value="5">特价商品</asp:ListItem>
                        <asp:ListItem Value="7">活动专区</asp:ListItem>
                        <asp:ListItem Value="9">最新商品</asp:ListItem>
                        <asp:ListItem Value="13">精品商品</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td width="100">
                </td>
                <td width="200">
                </td>
            </tr>
            <tr>
                <td>
                    显示标识
                </td>
                <td>
                    <asp:DropDownList ID="ddl_flag" runat="server" Height="27px" Width="149px">
                        <asp:ListItem Value="1">普通</asp:ListItem>
                        <asp:ListItem Value="3">团购</asp:ListItem>
                        <asp:ListItem Value="5">拍卖</asp:ListItem>
                        <asp:ListItem Value="7">点卡</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    排序选择
                </td>
                <td>
                    <asp:RadioButtonList ID="rbl_CompositorType" runat="server" RepeatDirection="Horizontal"
                        Height="24px" Width="119px">
                        <asp:ListItem Value="0" Selected="True">升序</asp:ListItem>
                        <asp:ListItem Value="1">降序</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    显示几行
                </td>
                <td>
                    <asp:TextBox ID="Tb_rows" runat="server" Width="147px" onkeyup="value=value.replace(/[^\d]/g,'') "
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">2</asp:TextBox>
                </td>
                <td>
                    排序字段
                </td>
                <td>
                    <asp:DropDownList ID="ddl_filed" runat="server" Height="25px" Width="137px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    显示几列
                </td>
                <td>
                    <asp:TextBox ID="Tb_Columns" runat="server" Width="147px" onkeyup="value=value.replace(/[^\d]/g,'') "
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">2</asp:TextBox>
                </td>
                <td>
                    是否分页
                </td>
                <td>
                    <asp:RadioButtonList ID="rbl_page" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">分页</asp:ListItem>
                        <asp:ListItem Value="1">不分页</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    名称长度
                </td>
                <td>
                    <asp:TextBox ID="tb_namelength" runat="server" Width="147px" onkeyup="value=value.replace(/[^\d]/g,'') "
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">8</asp:TextBox>
                </td>
                <td>
                    首页显示
                </td>
                <td>
                    <asp:RadioButtonList ID="rbl_first" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">不显示</asp:ListItem>
                        <asp:ListItem Value="1">首页显示</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    内容长度
                </td>
                <td>
                    <asp:TextBox ID="tb_ContentCharacter" runat="server" Width="150px" onkeyup="value=value.replace(/[^\d]/g,'') "
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">20</asp:TextBox>
                </td>
                <td>
                    布局方式
                </td>
                <td>
                    <asp:RadioButtonList ID="Rbl_TempletLayout" runat="server" Height="26px" RepeatDirection="Horizontal"
                        Width="116px">
                        <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                        <asp:ListItem Value="1">Table</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    商品参数
                </td>
                <td>
                    <asp:DropDownList ID="ddl_Properties" runat="server" Height="18px" Width="150px"
                        onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择商品属性--</asp:ListItem>
                        <asp:ListItem Value="[#Product_No]">商品货号</asp:ListItem>
                        <asp:ListItem Value="[#Product_Name]">商品名称</asp:ListItem>
                        <asp:ListItem Value="[#Product_MeasureUnit]">商品计量单位</asp:ListItem>
                        <asp:ListItem Value="[#Product_Key]">商品关键字</asp:ListItem>
                        <asp:ListItem Value="[#Product_Introduction]">商品简介</asp:ListItem>
                        <asp:ListItem Value="[#Product_ShopPrice]">商品商城价</asp:ListItem>
                        <asp:ListItem Value="[#Product_MarketPrice]">商品市场价</asp:ListItem>
                        <asp:ListItem Value="[#Product_Spread]">商品差价</asp:ListItem>
                        <asp:ListItem Value="<img src='[#Product_Thumbnails]' width='100px' height='100px'>">商品缩略图</asp:ListItem>
                        <asp:ListItem Value="<img src='[#Product_Bigmap]'>">商品大图</asp:ListItem>
                        <asp:ListItem Value="[#Product_Weight]">商品重量</asp:ListItem>
                        <asp:ListItem Value="[#Product_Units]">商品重量单位</asp:ListItem>
                        <asp:ListItem Value="[#Product_Stock]">商品库存</asp:ListItem>
                        <asp:ListItem Value="[#Product_ShelvesCount]">商品上架数量</asp:ListItem>
                        <asp:ListItem Value="[#Product_SellWay]">商品出售方式</asp:ListItem>
                        <asp:ListItem Value="[#Product_PickDownTime]">下架时间</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    显示省略号
                </td>
                <td>
                    <asp:RadioButtonList ID="rbl_WhetherOmit" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                        <asp:ListItem Value="True">是</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    拍卖参数
                </td>
                <td>
                    <asp:DropDownList ID="ddl_Auction" runat="server" Height="18px" Width="151px" onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择拍卖参数--</asp:ListItem>
                        <asp:ListItem Value="[#Auction_Name]">拍卖名称</asp:ListItem>
                        <asp:ListItem Value="[#Auction_StartTime]">拍卖开始时间</asp:ListItem>
                        <asp:ListItem Value="[#Auction_EndTime]">拍卖结束时间</asp:ListItem>
                        <asp:ListItem Value="[#Auction_StartPrice]">起拍价</asp:ListItem>
                        <asp:ListItem Value="[#Auction_AddLevel]">拍卖加价幅度</asp:ListItem>
                        <asp:ListItem Value="[#Auction_Deposit]">拍卖保证金</asp:ListItem>
                        <asp:ListItem Value="[#Auction_Description]">拍卖描述</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    团购参数
                </td>
                <td>
                    <asp:DropDownList ID="ddl_GroupBuy" runat="server" onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择团购参数--</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_StartTime]">团购活动开始时间</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_EndTime]">团购活动结束时间</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_Deposit]">团购保证金</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_BuyCount]">团购限购数量</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_DonateIntegral]">团购赠送积分</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_PriceLevel]">团购价格阶梯</asp:ListItem>
                        <asp:ListItem Value="[#GroupBuy_Description]">团购活动描述</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    点卡参数
                </td>
                <td>
                    <asp:DropDownList ID="ddl_card" runat="server" onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择点评参数--</asp:ListItem>
                        <asp:ListItem Value="[#card_FaceValue]">点卡面值</asp:ListItem>
                        <asp:ListItem Value="[#card_FaceValue]">点卡售价</asp:ListItem>
                        <asp:ListItem Value="[#card_Point]">点卡点数</asp:ListItem>
                        <asp:ListItem Value="[#card_Unit]">点卡单位</asp:ListItem>
                        <asp:ListItem Value="[#card_ExpirationDate#]">点卡截止日期</asp:ListItem>
                        <asp:ListItem Value="[#card_BusinessAgent#]">代理商</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    操作方式
                </td>
                <td>
                    <asp:DropDownList ID="ddl_Option" runat="server" onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择操作方式--</asp:ListItem>
                        <asp:ListItem Value="[#Option_Src]">商品内容页链接地址</asp:ListItem>
                        <asp:ListItem Value="[#Option_AuctionURL]">拍卖内容页链接地址</asp:ListItem>
                        <asp:ListItem Value="[#Option_GroupBuyURL]">团购内容页链接地址</asp:ListItem>
                        <asp:ListItem Value="[#Option_Buy]">放入购物车(图文)</asp:ListItem>
                        <asp:ListItem Value="[#Option_Favorites]">收藏商品(图文)</asp:ListItem>
                        <asp:ListItem Value="[#Option_Comparison]">商品比较(图文)</asp:ListItem>
                        <asp:ListItem Value="<img src='[#DummyPahtAndTemplatePaht]/images/图片名称.后缀名' border='0'/>">查看商品详情(图片)</asp:ListItem>
                        <asp:ListItem Value="<img src='[#DummyPahtAndTemplatePaht]/images/图片名称.后缀名' border='0'/>">放入购物车(图片)</asp:ListItem>
                        <asp:ListItem Value="[#BuyUrl]">放入购物车链接地址</asp:ListItem>
                        <asp:ListItem Value="<img src='[#DummyPahtAndTemplatePaht]/images/图片名称.后缀名' border='0'/>">收藏商品(图片)</asp:ListItem>
                        <asp:ListItem Value="[#CollectionUrl]">收藏商品链接地址</asp:ListItem>
                        <asp:ListItem Value="<img src='[#DummyPahtAndTemplatePaht]/images/图片名称.后缀名' border='0'/>">商品比较(图片)</asp:ListItem>
                        <asp:ListItem Value="[#ComparisonUrl]">商品比较链接地址</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr id="Specification" style="display:none;">
                <td>配件必备参数</td>
                <td colspan="3">
                    <asp:DropDownList ID="SpecificationPararmet" runat="server"  onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择配件必备参数--</asp:ListItem>
                        <asp:ListItem Value="[#Spe_Check]">复选框</asp:ListItem>
                        <asp:ListItem Value="[#Buy_Count]">购买数量文本框</asp:ListItem>
                        <asp:ListItem Value="[#Spe_GroupName]">配件组名称</asp:ListItem>
                        <asp:ListItem Value="[#Buy_SparCount]">购买配件数量范围</asp:ListItem>
                    </asp:DropDownList>
                    <span style="color:Red">注：配件通常出现在商品详细页，对商品进行打包销售。</span>
                </td>
            </tr>
            <tr>
                <td>
                    特殊模块
                </td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rdolstSpecial" runat="server" Height="26px" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">无限制</asp:ListItem>
                        <asp:ListItem Value="1">销售排行商品</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <input type="button" value="循环内容" onclick="getValue('{# 您要加的内容 #}')" /><br />
                    <br />
                    <span style="color: Red">注：当你添加了要循环的内容,该标签就循环你指定的内容;没有指定循环整个内容.</span><br />
                    <br />
                </td>
                <td colspan="3">
                    <asp:TextBox runat="server" ID="txtLabelContent" Height="200" onselect="setCaret(this);"
                        onclick="setCaret(this);" onkeyup="setCaret(this);" Width="500" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center" style="text-align: center">
                    <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 " onclick="javascript:CloseDiv();" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
